import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
     {
    path: '/',
    name: 'layout',
      redirect: '/home',
    component:  () => import('@/Layout/index.vue'),
    children: [
        {
            name: 'home',
            path: '/home',
            component:  () => import('@/views/home.vue'),
        },
        {
            name: 'user',
            path: '/user',
            component:  () => import('@/views/user/index.vue'),
        },
        {
            name: 'userSave',
            path: '/user/save/:id?',
            component:  () => import('@/views/user/save.vue'),
        },
        {
            name: 'role',
            path: '/role',
            component:  () => import('@/views/role/index.vue'),
        },
        {
            name: 'roleSave',
            path: '/role/save/:id?',
            component:  () => import('@/views/role/save.vue'),
        },
        {
            name: 'banner',
            path: '/banner',
            component:  () => import('@/views/banner/index.vue'),
            meta: {
                title: '广告管理'
            }
        },
        {
            name: 'bannerSave',
            path: '/banner/save/:id?',
            component:  () => import('@/views/banner/save.vue'),
        },
        {
            name: 'projectType',
            path: '/projectType',
            component:  () => import('@/views/projectType/index.vue'),
            meta: {
                title: '服务分类'
            }
        },
        {
            name: 'projectTypeSave',
            path: '/projectType/save/:id?',
            component:  () => import('@/views/projectType/save.vue'),
        },
        {
            name: 'projectList',
            path: '/projectList',
            component:  () => import('@/views/projectList/index.vue'),
            meta: {
                title: '服务项目'
            }
        },
        {
            name: 'projectListSave',
            path: '/projectList/save/:id?',
            component:  () => import('@/views/projectList/save.vue'),
        },
        {
            name: 'staffList',
            path: '/staffList',
            component:  () => import('@/views/staffList/index.vue'),
        },
        {
            name: 'staffListSave',
            path: '/staffList/save/:id?',
            component:  () => import('@/views/staffList/save.vue'),
        },
        {
            name: 'staffApply',
            path: '/staffApply',
            component:  () => import('@/views/staffList/apply.vue'),
        },
        {
            name: 'staffListAudit',
            path: '/staffList/audit/:id',
            component:  () => import('@/views/staffList/applyItem.vue'),
        },
        {
            name: 'order',
            path: '/order',
            component:  () => import('@/views/order/index.vue'),
        },
        {
            name: 'member',
            path: '/member',
            component:  () => import('@/views/member/index.vue'),
        },
        {
            name: 'memberSave',
            path: '/member/save/:id?',
            component:  () => import('@/views/member/save.vue'),
        },
        {
            name: 'city',
            path: '/city',
            component:  () => import('@/views/city/index.vue'),
        },
        {
            name: 'citySave',
            path: '/city/save/:id?',
            component:  () => import('@/views/city/save.vue'),
        },
        // {
        //     name: 'travelMode',
        //     path: '/travelMode',
        //     component:  () => import('@/views/travelMode/index.vue'),
        // },
        // {
        //     name: 'travelModeSave',
        //     path: '/travelMode/save/:id?',
        //     component:  () => import('@/views/travelMode/save.vue'),
        // },
        {
            name: 'policy',
            path: '/policy',
            component:  () => import('@/views/policy/index.vue'),
        },
        {
            name: 'policySave',
            path: '/policy/save/:id?',
            component:  () => import('@/views/policy/save.vue'),
        },
        {
            name: 'staffBalance',
            path: '/staffBalance',
            component:  () => import('@/views/staffBalance/index.vue'),
        },
        {
            name: 'staffBalanceSave',
            path: '/staffBalance/save/:id?',
            component:  () => import('@/views/staffBalance/save.vue'),
        },

    ]
  },
    {
        path: '/login',
        name: 'login',
        component:  () => import('@/views/Login.vue'),
    }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
